package com.test.quartz;

import com.test.quartz.jdbc.bean.Task;
import com.test.quartz.jdbc.mapper.TriggerMapper;
import com.test.quartz.jdbc.bean.Trigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

@SpringBootApplication
public class QuartzApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(QuartzApplication.class, args);
    }

    @Autowired
    private TriggerMapper triggerMapper;

    @Override
    public void run(String... args) throws Exception {
        //Trigger trigger = triggerMapper.findByName("trigger1");
        //System.out.println(trigger.toString());
        //System.out.println(trigger.toString());

        List<Task> all = triggerMapper.findAll();
        for (Task task : all){
            System.out.println(task.toString());
        }

    }
}
